<template>
  <div>
    <h2>Parent</h2>
    <p>子组件的count值：{{count}}</p>
    <h2>子组件</h2>
    <child :name="name" :age="age" @count="handleCount"></child>  
  </div>
</template>

<script>

import Child from "./Child";

import {ref} from "vue";

export default {
  setup() {
    let name = ref("Hydra");
    let age = ref(35);

    let count = ref(0);

    function handleCount(v) {
        count.value = v;
    }

    return {name,age,handleCount,count};
  },
  components: {
    Child
  }
};
</script>

<style>
</style>